<?php
/**
 * 2016.8.10作业一 留言板内容用文件存储
 * User: wuz
 * Date: 2016/8/10
 * Time: 9:07
 */
namespace Ycf\Lession\FormAndFile\MessageBoard;

class MessageBoard
{
    public function message($nickname, $content, $date)
    {
        $writeText = $date . "\t" . $nickname . ":" . "\n" . " 留言内容：" . $content . "\n";
        $file      = fopen("MessageBorad.txt", "a+"); //a指针位置在结尾 可以继续写入
        fwrite($file, $writeText);
        fclose($file);
        // file_put_contents('MessageBoard.txt', $writeText);
        header("Location: index.php");
    }
}
